<template>
  <header>
    <h1>
      <img src="@/assets/images/logo.png" alt="" />
    </h1>
    <div class="search" @click="goSearch">
      <i class="iconfont icon-fangdajing"></i>
      <span>搜索您喜欢的图书...</span>
    </div>
    <div class="kefu">
      <i class="iconfont icon-kefu"></i>
    </div>
  </header>
</template>

<script>
export default {
  methods: {
    goSearch() {
      this.$router.push("/search");
    },
  },
};
</script>

<style scoped>
header {
  position: relative;
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100vw;
  height: 1.4rem;
  background-color: #6cf;
}
header h1 {
  position: absolute;
  top: -9px;
  left: 0;
  padding: 1px 0.266666rem;
  width: 1.2rem;
  height: 1.2rem;
}
header h1 img {
  position: relative;
  top: 7px;
  width: 100%;
  height: 100%;
}
.search {
  position: absolute;
  display: flex;
  align-items: center;
  width: 6.56rem;
  height: 0.8rem;
  background-color: #ffffff;
  border-radius: 12px;
}
.search i {
  padding: 0 0.16rem;
  color: #ccc;
}
.search span {
  font-size: 0.373333rem;
  color: #ccc;
}
.kefu i {
  position: absolute;
  top: 5px;
  right: 15px;
  font-size: 0.96rem;
  color: #fff;
}
</style>
